/* $Id: Grade.java,v 1.1 2005/12/23 14:27:27 gigabass Exp $
*
* Copyright (c) Guido Ludwig. All rights reserved.
* Use is subject to license terms.
*/
package de.guidoludwig.jtm.domain;

public enum Grade {
	UNGRADED(""),
	A_PLUS("A+"),
	A("A"),
	A_MINUS("A-"),
	B_PLUS("B+"),
	B("B"),
	B_MINUS("B-"),
	C_PLUS("C+"),
	C("C"),
	C_MINUS("C-"),
	D("D");
	
	public static Grade valueOfDisplay(String display) {
		Grade[] grades = values();
		for (int i = 0; i < grades.length; i++) {
			if (grades[i].getDisplay().equals(display)) {
				return grades[i];
			}
		}
		throw new IllegalArgumentException(display + " not found as a Grade");
	}
	
	
	private String display;
	
	private Grade(String display) {
		this.display = display;
	}
	public String getDisplay() {
		return display;
	}
}
